Skip to content

Run socket connect and message polling on a thread#63

Merged
britzl merged 15 commits intomasterfrom
Issue-62-socket-receive-is-blocking-main-thread
Feb 2, 2026
Merged

Run socket connect and message polling on a thread#63
britzl merged 15 commits intomasterfrom
Issue-62-socket-receive-is-blocking-main-thread

Conversation

@britzl
Copy link
Contributor

@britzl britzl commented Jan 12, 2026

The socket connection, handshake and message polling is now done on a thread to not lock up the main thread every update.

Fixes #62

@britzl britzl marked this pull request as draft January 12, 2026 09:23
#endif

#if defined(HAVE_WSLAY)
static void ConnectionWorker(void* _conn)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire connect, handshake and websocket polling is now done here in ConnectionWorker in a thread

CLOSE_CONN("Connect sequence timed out");
return;
}
dmTime::Sleep(10*1000);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is a reasonable time to wait in between attempts?

@britzl britzl changed the title Issue 62 socket receive is blocking main thread Run socket connect and message polling on a thread Jan 13, 2026
@britzl britzl marked this pull request as ready for review January 13, 2026 11:02
@britzl britzl requested a review from JCash January 13, 2026 11:02
Copy link
Contributor

@JCash JCash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only a comment about potential shutdown/rebooting delays while threads are in flight.

@britzl britzl requested a review from JCash January 15, 2026 09:16
@britzl britzl merged commit a9264f9 into master Feb 2, 2026
24 checks passed
@britzl britzl deleted the Issue-62-socket-receive-is-blocking-main-thread branch February 2, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Socket receive is blocking the main thread

2 participants